--[[
VHeWS example of a simple discovery service as concept test.

This Code is part of the graduation project of Pedro Bittencourt e Silva,
VHeWS.
Developed to be used with Kepler running on Xavante (not tested in Apache)

@author Pedro Bittencourt
--]]

local file = io.open("sensor.dis","r")
local s = file:read("*a")
local pack = {}

for key,value in string.gmatch(s,"(.-)=(.-)\n") do
	pack[key] = value
end

if cgilua.QUERY.sID=="0" then
	for k,v in pairs(pack) do
		print(k.."="..v.."<br>")
	end
else
	print("This sensor is not registered")
end
